home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d12
/
v9n02.arc
/
BU.BAT
< prev
next >
Wrap
DOS Batch File
|
1990-01-02
|
2KB
|
68 lines
:--- BU.bat
@ECHO off
IF %2 '==' GOTO syntax
IF %1 == ? GOTO syntax
FOR %%o in (a e m A E M) do if %2==%%o GOTO test
FOR %%o in (c C) do GOTO create
GOTO syntax
:test
IF EXIST A:\%1.DIR GOTO ok
ECHO %1.dir was not found on drive A:. Place the %1 back-up disk in the
ECHO A: drive and then press any key to proceed. You may quit and then type
ECHO .
ECHO BU %1 c
ECHO .
ECHO in order to copy the %1.dir file to the BU diskette.
ECHO To quit hold the Ctrl key and press 'c' and then 'y';
PAUSE
GOTO test
:ok
:ADD in the parentheses below the directories on the D: drive.
FOR %%d IN (asy qb ASY QB) DO IF %%d==%1 GOTO ddrive
:ADD in the parentheses below the directories on the C: drive.
FOR %%d IN (dos mw wrk DOS MW WRK) DO IF %%d==%1 GOTO cdrive
GOTO update
:ddrive
D:
GOTO l1
:cdrive
C:
:l1
cd \%1
:ADD in parentheses below the directories that require custom procedures.
FOR %%d IN (dos wrk DOS WRK) DO IF %%d==%1 GOTO %1
GOTO makebu
:dos
ECHO Resetting archive bits...
ATTRIB -A BAT\?????SET.BAT > NUL
ATTRIB -A BAT\????SET.BAT > NUL
GOTO makebu
:wrk
ECHO Resetting archive bits...
ATTRIB -A SAS\SASWORK\*.* > NUL
ATTRIB -A SAS\SASUSER\*.* > NUL
GOTO makebu
:makebu
ECHO Deleting *.bak file(s)...
SWEEP IF EXIST *.BAK DEL *.BAK > NUL
XCOPY *.* A:\/%2/V/S %3
GOTO end
:create
ECHO Copying %1.dir to the BU diskette...
ECHO %1.DIR> A:\%1.DIR
GOTO end
:update
ECHO %1 is not included among the BU directories. Modify BU.BAT: Add the
ECHO directory name as indicated in the BU batch program.
GOTO end
:syntax
ECHO Syntax: BU dir a│c│e│m [/P(rompt)[/D:date]]
ECHO │ │ │ └─ archive and reset the archive bit or
ECHO │ │ └─── archive all files or
ECHO │ └───── copy an identifying file to a new BU disk or
ECHO └─────── archive and do not reset the archive bit.
:end